package experiment5.task;

import java.io.Closeable;
import java.io.IOException;

/**
 * @Description: 关闭资源的工具类
 * @author:fyl
 * @date 2021/4/22 9:45
 * @Modified By:
 * @Modified Date:
 */
public class CloseUtil {

    public static void closeAll(Closeable... closeable) {
        try {
            for (Closeable sourse : closeable) {
                if (sourse != null) {
                    sourse.close();
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
